using Microsoft.AspNetCore.Http;

namespace Elsa.Http.Options;

/// <summary>
/// Provides various options related to the HTTP activities.
/// </summary>
public class HttpActivityOptions
{
    /// <summary>
    /// The root path at which HTTP activities can be invoked.
    /// </summary>
    public PathString? BasePath { get; set; } = "/workflows";
        
    /// <summary>
    /// The base URL of the server. This should be set to the same value at which the Elsa Server is publicly available. It will be used when generating absolute URLs need to be generated by activities such as SendEmail. 
    /// </summary>
    public Uri BaseUrl { get; set; } = default!;

    /// <summary>
    /// The prefix used for API routes.
    /// </summary>
    public string ApiRoutePrefix { get; set; } = "elsa/api";

    /// <summary>
    /// A configurable set of available content types available from the <see cref="WriteHttpResponse"/> activity.
    /// </summary>
    public ISet<string> AvailableContentTypes { get; set; } = new SortedSet<string>
    {
        "application/json", 
        "application/xml", 
        "application/x-www-form-urlencoded", 
        "application/octet-stream",
        "text/plain", 
        "text/html",
        "text/json", 
        "text/xml",
    };
}